package com.sinping.qh.service.admin;

import com.sinping.qh.api.support.FrontPage;
import com.sinping.qh.api.support.ResDto;
import com.sinping.qh.domain.auth.Role;
import com.sinping.qh.domain.user.UserInfo;
import com.sinping.qh.dto.admin.lab.ApiUnitAndLabDto;
import com.sinping.qh.dto.admin.user.ApiUserDto;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 用户添加和修改
 *
 * @author Tiansx
 * @create 2018-05-28 18:49
 **/
public interface IAddorEditUserService {
    /**
     * 添加用户
     * @param apiuserDTO
     */
     ResDto addUser(HttpServletRequest request, ApiUserDto apiuserDTO);
    /***
     * 更新用户
     */
    ResDto updateUser(HttpServletRequest request,ApiUserDto apiuserDTO);
    /**
     * 删除用户
     */
    ResDto deleteUser(String id);
    /**
     * 获取用户详情
     */
    ResDto getUserDetail(String  id);
    /**
     * 获取用户列表，分页
     */
    ResDto getUserList(HttpServletRequest request,FrontPage page);
    /**
     * 删除用户负责的院系/实验室
     */
    ResDto deleteUnitAndLabToUser(HttpServletRequest httpRequest,ApiUnitAndLabDto apiUnitAndLabDto);

    ///////////////////////////////

    /**
     * 获取用户负责的院系
     * @param httpRequest
     * @return
     */
    ResDto getUserManagerUnit(HttpServletRequest httpRequest,String userId,String status);

    /**
     * 所有院系分组的实验室列表
     * @return
     */
    ResDto getAllLabList();
    /**
     * 用户负责院系分组的实验室列表
     * @return
     */
    ResDto getUserManagerLabList(HttpServletRequest httpRequest,String userId);

    /**
     * 配置负责院系
     */

    ResDto addUnitToUser(HttpServletRequest request,ApiUnitAndLabDto apiUnitAndLabDto);
    /**
     * 配置负责实验室
     */
    ResDto addLabToUser(HttpServletRequest request,ApiUnitAndLabDto apiUnitAndLabDto);
    /**
     * 删除用户负责的院系
     */
    ResDto deleteUnitToUser(HttpServletRequest request,ApiUnitAndLabDto apiUnitAndLabDto);
    /**
     * 删除用户负责的实验室
     */
    ResDto deleteLabToUser(HttpServletRequest request,ApiUnitAndLabDto apiUnitAndLabDto);
    ResDto getRoleList();

    List<UserInfo>findUserByRoleId(Role role,Role roleDB);
    /**
     * 通过院系id获取实验室
     */
    ResDto getLabListByUnitId(String unitId);
}
